#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<cstdlib>//rand()
#define rep(i,a,b) for(register int i = (a);i <= (b);++i)
#define per(i,a,b) for(register int i = (a);i >= (b);--i)
using std::string;using std::cin;using std::cout;

const int mod = 998244353;
int hh,ll,h_,l_;
long long dp[3005][3005];

int main(){
    std::ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    // freopen("color.in", "r", stdin);
    cin >> hh >> ll >> h_ >> l_;
    dp[hh][ll] = 1;
    rep(i,1,h_){
        rep(j,1,l_){
            if(i < hh || j < ll || (i == hh && j == ll)) continue;
            dp[i][j] = dp[i-1][j] * j % mod + dp[i][j-1] * i % mod + mod - (i-1) * (j-1) * dp[i-1][j-1] % mod;
            dp[i][j] %= mod;
        }
    }
    cout << dp[h_][l_] << "\n";
    return 0;
}